$(function () {
    var thishtmlId = getQueryString('thishtmlId')
    init()
    function init() {
        xiangxi(thishtmlId);
    }

    // 商品详细信息介绍
    function xiangxi(thishtmlId) {
        console.log(getQueryString('productid'));
        console.log(thishtmlId);
        
        
    if (thishtmlId==1) {
        $.ajax({
            type:"get",
            url:'http://193.112.55.79:9090/api/getdiscountproduct',
            // url:"http://193.112.55.79:9090/api/getmoneyctrlproduct",
            data:{
                productid:getQueryString('productid')
            },
            success:function(result){
                console.log(result);
                let data=result.result;
                let html=template("xqing2",{arr:data})
                $(".mmview").html(html);
            }
        })
    }else{
        $.ajax({
            type:"get",
            // url:'http://193.112.55.79:9090/api/getdiscountproduct',
            url:"http://193.112.55.79:9090/api/getmoneyctrlproduct",
            data:{
                productid:getQueryString('productid')
            },
            success:function(result){
                console.log(result);
                let data=result.result;
                let html=template("xqing",{arr:data})
                $(".mmview").html(html);
            }
        })
    }
        

    }
})
/*取到字符串里面的数字 */
function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    // if (r != null) return unescape(r[2]);
    if (r != null) return decodeURI(r[2]);
    return null;
}